- drop load_environment_flag and always load environment on start, making
restart command great again
- store/restore existing jshn namespace when using json()
- remove unneeded sleepCount in is_wan_up()
- move updated README inside files/
Signed-off-by: Stan Grishin <[email protected]>
PKG_NAME:=pbr
PKG_VERSION:=1.1.8
-PKG_RELEASE:=34
+PKG_RELEASE:=36
PKG_LICENSE:=AGPL-3.0-or-later
+++ /dev/null
-# Policy-Based Routing (pbr)
-
-[](https://openwrt.org)
-[](https://docs.openwrt.melmac.ca/pbr/)
-[](https://github.com/stangri/pbr/blob/master/LICENSE)
-
-Flexible policy-based routing (PBR) framework for OpenWrt.
-Allows routing specific traffic (by IP, MAC, port, protocol, or domain) through a specific WAN, VPN, or tunnel.
-
-## Features
-
-- Route by IP, MAC, port, or domain name
-- Works with WAN, VPNs (WireGuard, OpenVPN), or tunnels
-- Lightweight shell-based implementation
-- Optional Web UI integration via LuCI
-
-**Full documentation:**
-[https://docs.openwrt.melmac.ca/pbr/](https://docs.openwrt.melmac.ca/pbr/)
-# README
+# Policy-Based Routing (pbr)
-README is available at [https://docs.openwrt.melmac.net/pbr/](https://docs.openwrt.melmac.net/pbr/).
+[](https://openwrt.org)
+[](https://docs.openwrt.melmac.ca/pbr/)
+[](https://github.com/stangri/pbr/blob/master/LICENSE)
+
+Flexible policy-based routing (PBR) framework for OpenWrt.
+Allows routing specific traffic (by IP, MAC, port, protocol, or domain) through a specific WAN, VPN, or tunnel.
+
+## Features
+
+- Route by IP, MAC, port, or domain name
+- Works with WAN, VPNs (WireGuard, OpenVPN), or tunnels
+- Lightweight shell-based implementation
+- Optional Web UI integration via LuCI
+
+**Full documentation:**
+[https://docs.openwrt.melmac.ca/pbr/](https://docs.openwrt.melmac.ca/pbr/)
nft_set_timeout=
# run-time
-load_environment_flag=
aghConfigFile='/etc/AdGuardHome/AdGuardHome.yaml'
gatewaySummary=
wanIface4=
return "$_ret"
}
local param="$1" validation_result="$2"
- [ -z "$load_environment_flag" ] || return 0
case "$param" in
on_boot|on_start)
json init
load_network "$param"
;;
esac
- load_environment_flag=1
}
# shellcheck disable=SC2317
}
is_wan_up() {
- local sleepCount='1' param="$1"
+ local param="$1"
if [ -z "$(uci_get network "$procd_wan_interface")" ]; then
json add error 'errorNoWanInterface' "$procd_wan_interface"
json add error 'errorNoWanInterfaceHint'
json() {
local status message stats i
local action="$1" param="$2" value="$3"; shift 3; local info="$*";
+ local _current_namespace="$_JSON_PREFIX"
[ "$param" = 'error' ] && param='errors'
[ "$param" = 'warning' ] && param='warnings'
+ json_set_namespace "${packageName}_"
{ json_load_file "$runningStatusFile" || json_init; } >/dev/null 2>&1
case "$action" in
'get')
fi
printf "%b" "$i"
json_select ..
+ json_set_namespace "$_current_namespace"
return
;;
'add')
mkdir -p "${runningStatusFile%/*}"
json_dump > "$runningStatusFile"
sync
+ json_set_namespace "$_current_namespace"
}
resolver() {